package com.gec.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gec.model.system.ITripItineraryOrder;
import com.gec.model.system.ITripServiceOrder;
import com.gec.model.vo.ITripServiceOrderVo;
import com.gec.system.mapper.ITripServiceOrderMapper;
import com.gec.system.service.ITripServiceOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户套餐订单表 服务实现类
 * </p>
 *
 * @author dafei
 * @since 2024-01-22
 */
@Service
public class ITripServiceOrderServiceImpl extends ServiceImpl<ITripServiceOrderMapper, ITripServiceOrder> implements ITripServiceOrderService {

    @Override
    public IPage<ITripServiceOrder> selectPage(IPage<ITripServiceOrder> page1, ITripServiceOrderVo iTripServiceOrderVo) {
        IPage<ITripServiceOrder> iPage = this.baseMapper.selectPage(page1,iTripServiceOrderVo,null) ;
        return iPage;
    }

    @Override
    public List<ITripServiceOrder> getByIsPaid(Long isPaid) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("isPaid",isPaid);//相当于where name=1
        List<ITripServiceOrder> list = baseMapper.selectList(wrapper);
        return list;
    }

    @Override
    public List<ITripServiceOrder> getByUserId(Long id) {

        List<ITripServiceOrder> list = baseMapper.getAllByUserId(id);
        return list;
    }
}
